<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">



  <meta name="description" content="关于python登陆页面"/>




  <meta name="keywords" content="flask, python, 八一" />



  <meta name="baidu-site-verification" content="HhUstaSjr0" />



  <meta name="google-site-verification" content="UA-102975942-1" />






  <link rel="alternate" href="/atom.xml" title="八一">




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=2.6.0" />



<link rel="canonical" href="https://bay1.top/2017/04/07/关于python登陆页面/"/>


<link rel="stylesheet" type="text/css" href="/css/style.css?v=2.6.0" />
<link rel="stylesheet" type="text/css" href="/css/prettify.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/sons-of-obsidian.css" media="screen" />



  <link rel="stylesheet" type="text/css" href="/lib/fancybox/jquery.fancybox.css" />




  
  <script id="baidu_analytics">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?9a885cc9fb6cd7bcef579deb8efe8a70";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>



  <script id="google_analytics">
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

        ga('create', 'UA-102975942-1', 'auto');
        ga('send', 'pageview');
  </script>










    <title> 关于python登陆页面 - 八一 </title>
  </head>

  <body><div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/." class="logo">八一</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>

<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    
      <a href="/archives">
        <li class="mobile-menu-item">
          
          
            文章
          
        </li>
      </a>
    
      <a href="/tags">
        <li class="mobile-menu-item">
          
          
            标签
          
        </li>
      </a>
    
      <a href="/about">
        <li class="mobile-menu-item">
          
          
            关于/友链
          
        </li>
      </a>
    
      <a href="/search">
        <li class="mobile-menu-item">
          
          
            站内搜索
          
        </li>
      </a>
    
  </ul>
</nav>

    <div class="container" id="mobile-panel">
      <header id="header" class="header"><div class="logo-wrapper">
  <a href="/." class="logo">八一</a>
</div>

<nav class="site-navbar">
  
    <ul id="menu" class="menu">
      
        <li class="menu-item">
          <a class="menu-item-link" href="/archives">
            
            
              文章
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/tags">
            
            
              标签
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/about">
            
            
              关于/友链
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/search">
            
            
              站内搜索
            
          </a>
        </li>
      
    </ul>
  
</nav>

      </header>

      <main id="main" class="main">
        <div class="content-wrapper">
          <div id="content" class="content">
            
  
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          关于python登陆页面
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2017-04-07
        </span>
        
        
        
      </div>
    </header>

    
    
  <div class="post-toc" id="post-toc">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#flask代码的基本结构"><span class="toc-text">flask代码的基本结构</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#简单的flask代码"><span class="toc-text">简单的flask代码</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#用户页面代码"><span class="toc-text">用户页面代码</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#init-py"><span class="toc-text">init.py</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#forms-py"><span class="toc-text">forms.py</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#views-py"><span class="toc-text">views.py</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#config-py"><span class="toc-text">config.py</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#run-py"><span class="toc-text">run.py</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#遇到的坑"><span class="toc-text">遇到的坑</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#包路径"><span class="toc-text">.包路径</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#验证"><span class="toc-text">.验证</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#重定向"><span class="toc-text">.重定向</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#小声明"><span class="toc-text">.小声明</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#小结"><span class="toc-text">小结</span></a></li></ol>
    </div>
  </div>


    <div class="post-content">
      
        <p>只想在文首说一句：什么事情的水都深！！！<br>以下所有文字几乎都是本人理解，不足之处，望大牛多多指教。 <a id="more"></a></p>
<blockquote>
<p>这是继上次前端页面之后的，主要是对flask 框架的基本认识，和用户认证的简单编写<br>这个过程真的。。。处处是坑。。。还由于课程等其他事情，进程缓慢<br>不过幸好有耐心的组长，在这里也是非常感谢的，淳淳教导！</p>
</blockquote>
<h2 id="flask代码的基本结构"><a href="#flask代码的基本结构" class="headerlink" title="flask代码的基本结构"></a>flask代码的基本结构</h2><p><strong>先贴一张图片</strong><br><img src="https://s1.ax1x.com/2018/01/01/pSRtcd.png" alt="flask-1"></p>
<blockquote>
<p>结构大概就是如此，目录app中涵盖主要的内容<br>向下又分为文件夹<span style="color: red;">static</span>：主要是html所需要的css之类的东西<br>文件夹<span style="color: red;">templates</span>：主要是html文件<br>然后在app目录下还有必要的<span style="color: red;"><strong>init</strong>.py</span>(这个脚本作用大概就是指明该目录是一个py包，并且可以导入东西，将东西加载到路径)<br><span style="color: red;">forms.py</span>：填写表单类，比如我将要写的LoginForm(Form)<br><span style="color: red;">views.py</span>:这就是视图函数的集中地了<br>除了上面的*.py,还会有其他的比如error.py等<br><span style="color: red;">tmp文件夹</span>中，配置脚本，比如config.py,测试用的run.py也可以放在里面</p>
</blockquote>
<h2 id="简单的flask代码"><a href="#简单的flask代码" class="headerlink" title="简单的flask代码"></a>简单的flask代码</h2><blockquote>
<p>首先说下，什么是视图函数？什么是路由？（这个东西我一开始也没仔细研究，不过等你看多了也自然明白是什么了）<br><span style="color: red;">路由</span>：客户端（例如 Web 浏览器）把请求发送给 Web 服务器，Web 服务器再把请求发送给<br>Flask程序实例。程序实例需要知道对每个 URL 请求运行哪些代码，所以保存了一个 URL 到 Python 函数的映射关系。处理 URL 和函数之间关系的程序称为路由。<br><span style="color: red;">视图函数</span>：就是下面代码中的index()<br>上面是官方语言，下面用个例子</p>
</blockquote>
<figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">@app.route(<span class="string">'/'</span>)</span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">index</span><span class="params">()</span></span><span class="symbol">:</span></span><br><span class="line">	<span class="keyword">return</span> <span class="string">'&lt;h1&gt;Hello World!&lt;/h1&gt;'</span></span><br></pre></td></tr></table></figure>
<p>说了这么多，来段实例吧<br><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> flask <span class="keyword">import</span> Flask</span><br><span class="line">app = Flask(__name__) </span><br><span class="line"><span class="string">'''</span></span><br><span class="line"><span class="string">这段代码是初始化程序，感觉就像c++中的头文件。。。。。</span></span><br><span class="line"><span class="string">不知道理解的对不对</span></span><br><span class="line"><span class="string">'''</span></span><br><span class="line"><span class="meta">@app.route('/')</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">index</span><span class="params">()</span>:</span></span><br><span class="line">	<span class="keyword">return</span> <span class="string">'&lt;h1&gt;Hello World!&lt;/h1&gt;'</span> </span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">'__main__'</span>:</span><br><span class="line">	app.run(debug=<span class="keyword">True</span>)</span><br><span class="line"><span class="string">'''</span></span><br><span class="line"><span class="string">这两句是调试，启动服务器，默认地址127.0.0.1:5000,地址可以自定</span></span><br><span class="line"><span class="string">'''</span></span><br></pre></td></tr></table></figure></p>
<h2 id="用户页面代码"><a href="#用户页面代码" class="headerlink" title="用户页面代码"></a>用户页面代码</h2><h3 id="init-py"><a href="#init-py" class="headerlink" title="init.py"></a><strong>init</strong>.py</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> flask <span class="keyword">import</span> Flask</span><br><span class="line">app = Flask(__name__)</span><br><span class="line">app.config.from_object(<span class="string">'config'</span>) <span class="comment">##读取配置文件</span></span><br><span class="line"><span class="keyword">from</span> app <span class="keyword">import</span> views</span><br></pre></td></tr></table></figure>
<blockquote>
<p>初始化程序，并且导入views和配置文件config</p>
</blockquote>
<h3 id="forms-py"><a href="#forms-py" class="headerlink" title="forms.py"></a>forms.py</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> wtforms.validators <span class="keyword">import</span> Length</span><br><span class="line"><span class="keyword">from</span> flask.ext.wtf <span class="keyword">import</span> Form</span><br><span class="line"><span class="keyword">from</span> wtforms <span class="keyword">import</span> StringField,PasswordField,SubmitField,ValidationError</span><br><span class="line"><span class="keyword">from</span> wtforms.validators <span class="keyword">import</span> DataRequired</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">LoginForm</span><span class="params">(Form)</span>:</span></span><br><span class="line">	username = StringField(<span class="string">'Username'</span>, validators=[DataRequired(), Length(<span class="number">1</span>, <span class="number">64</span>)])</span><br><span class="line">	password = PasswordField(<span class="string">'Password'</span>, validators=[DataRequired()])</span><br><span class="line">	<span class="string">'''</span></span><br><span class="line"><span class="string">	两个文本框，用户名和密码</span></span><br><span class="line"><span class="string">	Length可以核对长度</span></span><br><span class="line"><span class="string">	DataRequired检查相应域提交的数据是否是空</span></span><br><span class="line"><span class="string">	'''</span></span><br><span class="line">	submit = SubmitField(<span class="string">'Login'</span>)</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">validate_username</span><span class="params">(self, field)</span>:</span></span><br><span class="line">		<span class="keyword">if</span> field.data != <span class="string">'admin'</span>:</span><br><span class="line">			<span class="keyword">raise</span> ValidationError(<span class="string">'用户名无效'</span>)</span><br><span class="line"></span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">validate_password</span><span class="params">(self, field)</span>:</span></span><br><span class="line">		<span class="keyword">if</span> field.data != <span class="string">'admin'</span>:</span><br><span class="line">			<span class="keyword">raise</span> ValidationError(<span class="string">'密码无效'</span>)</span><br></pre></td></tr></table></figure>
<blockquote>
<p>表单代码，下面是官方语言：<br>Flask-WTF扩展可以把处理 Web 表单的过程变成一 种愉悦的体验。<br>这个扩展对独立的 WTForms包进行了包 装，方便集成到 Flask 程序中。<br>也很方便</p>
</blockquote>
<h3 id="views-py"><a href="#views-py" class="headerlink" title="views.py"></a>views.py</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> flask <span class="keyword">import</span> render_template, flash, redirect</span><br><span class="line"><span class="keyword">from</span> app <span class="keyword">import</span> app</span><br><span class="line"><span class="keyword">from</span> .forms <span class="keyword">import</span> LoginForm</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="meta">@app.route('/login', methods = ['GET', 'POST'])</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">login</span><span class="params">()</span>:</span></span><br><span class="line">	form = LoginForm()</span><br><span class="line">	<span class="keyword">if</span> form.validate_on_submit():</span><br><span class="line">		flash(<span class="string">'登陆成功！'</span>)</span><br><span class="line">		<span class="keyword">return</span> redirect(<span class="string">'/sign'</span>)<span class="comment">##重定向</span></span><br><span class="line">	<span class="keyword">return</span> render_template(<span class="string">'login.html'</span>,title=<span class="string">'登录'</span>,form = form)</span><br><span class="line">	</span><br><span class="line"><span class="meta">@app.route('/')</span></span><br><span class="line"><span class="meta">@app.route('/index')</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">index</span><span class="params">()</span>:</span></span><br><span class="line">	user = &#123; <span class="string">'nickname'</span>: <span class="string">'guy'</span> &#125;</span><br><span class="line">	<span class="keyword">return</span> render_template(<span class="string">"index.html"</span>,user = user)</span><br><span class="line"></span><br><span class="line"><span class="meta">@app.route('/sign',methods=['GET','POST'])</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">sign</span><span class="params">()</span>:</span></span><br><span class="line">	<span class="keyword">return</span> render_template(<span class="string">"sign.html"</span>)</span><br><span class="line"></span><br><span class="line"><span class="meta">@app.route('/404', methods = ['GET', 'POST'])</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">error</span><span class="params">()</span>:</span></span><br><span class="line">	<span class="keyword">return</span> render_template(<span class="string">"404.html"</span>),<span class="number">404</span></span><br></pre></td></tr></table></figure>
<blockquote>
<p>首先说下<span style="color: red;">flash</span>，就是一个可以返回消息告诉用户状态发生了变化，而且仅仅在python中这样写是没用的，需要在前端渲染一下（我不会这个东西。。。）<br>再说<span style="color: red;">render_template</span>，它是一个可以渲染html页面并返回的函数，同时他的参数，比如user=user，第一个user是代表html中的user,第二个则是函数中的user，这样也就是传值<br><span style="color: red;">redirect</span>，这个函数重定向函数，不用多解释了。<br><span style="color: red;">form.validate_on_submit</span>,如果提交的表单通过验证，这个函数返回true,否则返回false</p>
</blockquote>
<h3 id="config-py"><a href="#config-py" class="headerlink" title="config.py"></a>config.py</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">CSRF_ENABLED = <span class="keyword">True</span> <span class="comment">##CSRF_ENABLED 配置是为了激活 跨站点请求伪造 保护</span></span><br><span class="line">SECRET_KEY = <span class="string">'hahhahahahaha'</span> <span class="comment">##用来建立一个加密的令牌</span></span><br></pre></td></tr></table></figure>
<blockquote>
<p>这个看的官方。。。。orz</p>
</blockquote>
<h3 id="run-py"><a href="#run-py" class="headerlink" title="run.py"></a>run.py</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">##!flask/bin/python</span></span><br><span class="line"><span class="keyword">from</span> app <span class="keyword">import</span> app</span><br><span class="line">app.run(debug = <span class="keyword">True</span>)</span><br></pre></td></tr></table></figure>
<blockquote>
<p>这一段启动服务器</p>
</blockquote>
<h2 id="遇到的坑"><a href="#遇到的坑" class="headerlink" title="遇到的坑"></a>遇到的坑</h2><h3 id="包路径"><a href="#包路径" class="headerlink" title=".包路径"></a>.包路径</h3><blockquote>
<p>在导入包的过程中，比如from .forms import LoginForm，很明显”.“代表本个，“..”代表上个，似乎没用过”..”<br>而app,是一个算是实例化的物体吧，可以从直接从from app import app，第一个app是目录</p>
</blockquote>
<h3 id="验证"><a href="#验证" class="headerlink" title=".验证"></a>.验证</h3><blockquote>
<p>一开始真的不知道怎么验证用户名，一直将代码写在了index()视图函数中<br>后来直接在表单LoginForm()直接多定义两个函数，我认为是没有数据库的对策</p>
</blockquote>
<h3 id="重定向"><a href="#重定向" class="headerlink" title=".重定向"></a>.重定向</h3><blockquote>
<p>我这里是重定向sign页面，在路由链接之后，我一开始是这样写的<br><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@app.route('/sign')</span></span><br></pre></td></tr></table></figure></p>
</blockquote>
<blockquote>
<p>然后会返回这种东西<br><img src="https://s1.ax1x.com/2018/01/01/pSRwHP.png" alt="flask-2"><br>加上methods=[‘GET’,’POST’]就好了</p>
</blockquote>
<h3 id="小声明"><a href="#小声明" class="headerlink" title=".小声明"></a>.小声明</h3><blockquote>
<p>这里的sign.html只是跳转之后写的简单页面<br>就下面这么多。。。。</p>
</blockquote>
<figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">html</span> <span class="attr">lang</span>=<span class="string">"zh-cn"</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">meta</span> <span class="attr">content</span>=<span class="string">"text/html; charset=utf-8"</span> /&gt;</span></span><br><span class="line">	<span class="tag">&lt;<span class="name">h1</span>&gt;</span>登陆成功！<span class="tag">&lt;/<span class="name">h1</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></span><br></pre></td></tr></table></figure>
<h2 id="小结"><a href="#小结" class="headerlink" title="小结"></a>小结</h2><blockquote>
<p>总体认为认识到的问题是很多的，虽然很简单，但是感觉<br>对于小白来说总是会遇到很多坑，不过有收获就很不错了</p>
</blockquote>

      
    </div>

    
      
      



      
      
    

    
      <footer class="post-footer">
        
          <div class="post-tags">
            
              <a href="/tags/flask/">flask</a>
            
              <a href="/tags/python/">python</a>
            
          </div>
        
        
        
  <nav class="post-nav">
    
      <a class="prev" href="/2017/04/12/requests库的学习/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text nav-default">requests库的初级学习</span>
        <span class="prev-text nav-mobile">上一篇</span>
      </a>
    
    
      <a class="next" href="/2017/03/28/python虚拟环境的搭建/">
        <span class="next-text nav-default">python虚拟环境的搭建</span>
        <span class="prev-text nav-mobile">下一篇</span>
        <i class="iconfont icon-right"></i>
      </a>
    
  </nav>

      </footer>
    

  </article>


          </div>
          
  <div class="comments" id="comments">
      <div id="disqus_thread">
        <noscript>
          Please enable JavaScript to view the
          <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
      </div> 
    </div>
  </div>


        </div>
      </main>

      <footer id="footer" class="footer">

  <div class="social-links">
    
      
        
          <a href="https://github.com/bay1" class="iconfont icon-github" title="github"></a>
        
      
    
      
        
          <a href="http://weibo.com/3190704711/profile?topnav=1&wvr=6&is_all=1" class="iconfont icon-weibo" title="weibo"></a>
        
      
    
      
    
      
    
      
    
    
    
  </div>


<div class="copyright">
  <span class="copyright-year">
    
    &copy; 
     
      2016 - 
    
    2018
    <span class="author">bay1</span>
  </span>
</div>
      </footer>

      <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
      </div>
    </div>

    
  
  <script type="text/javascript">
    var disqus_config = function () {
        this.page.url = 'https://bay1.top/2017/04/07/关于python登陆页面/';
        this.page.identifier = '2017/04/07/关于python登陆页面/';
        this.page.title = '关于python登陆页面';
    };
    (function() {
    var d = document, s = d.createElement('script');

    s.src = '//https-blog-flywinky-top-1.disqus.com/embed.js';

    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();  
  </script>



    
  





  
    <script type="text/javascript" src="/lib/jquery/jquery-3.1.1.min.js"></script>
  

  
    <script type="text/javascript" src="/lib/slideout/slideout.js"></script>
  

  
    <script type="text/javascript" src="/lib/fancybox/jquery.fancybox.pack.js"></script>
  


    <script type="text/javascript" src="/js/src/even.js?v=2.6.0"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=2.6.0"></script>
<script src="/js/prettify.js"></script>
<script type="text/javascript">
$(document).ready(function(){
 $('pre').addClass('prettyprint');
   prettyPrint();
 })
</script>
  </body>
</html>
